<template>
    <div style="width: 100%;height: 100%;border: 1px solid #ff00ff;">
        <el-carousel height="600px" indicator-position="none">
            <el-carousel-item v-for="item in pics" :key="item">
                <h3 class="small">
                    <img :src="item"/>

                </h3>
            </el-carousel-item>
        </el-carousel>


    </div>
</template>

<script>
    import axios from "axios";
    import {ifHasCode,
        checkState,
        SetMachineState,
        openDoor,
        onLeft,
        onRight,
        uploadImage,
        leftRotate} from './../api/api'

    export default {
        name: "Test",
        data: function () {
            return {
                name: "zhangsan",
                count: 3,
                pics: [
                    "https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w%3d580/sign=dcc1a0127e3e6709be0045f70bc79fb8/03f29094a4c27d1ea95c67f11ad5ad6edcc438de.jpg",
                    "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1673591859,1503781665&fm=26&gp=0.jpg",
                    "https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1139816541,416976334&fm=26&gp=0.jpg"
                ]
            }
        },

        created() {

            //this.getToken();
            //this.checkState();
            //this.SetMachineState();//上传错误代码
            //this.sayhello();
            //this.upfile();
            //this.leftRoate();
            this.ifOnLeft();

        },
        methods: {

            ifOnLeft() {
                onLeft().then((res) => {
                    console.log("是否在左的状态===========")
                    console.log(res);
                });
            },
            ifOnRight() {
                onRight().then((res) => {
                    console.log("是否在左的状态===========")
                    console.log(res);
                });
            },

            SetMachineState() {
                SetMachineState("a0033", 1).then((res) => {
                    console.log(res);
                });
            },
            checkState() {
                console.log("==========");
                checkState().then((res) => {
                    console.log(res);
                });
            },
            getToken() {
                axios.get(`http://hs.api.chenglai.net/api/Login/GetJwtToken`, {
                    params: {
                        username: 'A001',
                        password: 'A001'
                    }
                }).then((res) => {
                    window.sessionStorage.setItem("token", res.data.data.token.token);
                });
            },
            sayhello() {
                ifHasCode('').then((res) => {

                       console.log(res);

                    }).catch((err) => {
                        console.log(err);
                    });


            },

            upfile()
            {

                uploadImage("C:/1.png").then((res)=>{
                    console.log(res);
                });

            },

            leftRoate()
            {
                console.log("左转");
                leftRotate().then((res)=>{
                    console.log(res);
                });

            }
            // getList() {
            //     console.log("Hello")
            //     axios.post(`http://hs.api.chenglai.net/api/PhyscialMachine/GetRecycleItemList`, {
            //         params: {
            //             name: '',
            //             code: '',
            //             type: "",
            //             pageSize: 10,
            //             pageIndex: 1,
            //         }
            //     }).then((res) => {
            //
            //         return res.data.response;
            //     });
            //
            //
            // },


        }


    }
</script>

<style scoped>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 150px;
        margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }

</style>